import { from } from 'form-data'
import { request } from './request'
import { Session } from '../utils/storage'
import * as CryptoJS from 'crypto-js';

import { TEST_URL, PROD_URL, PRINT_BASE_URL } from '@/constant/config.js'
import { SET_BASEURL, PRINT_BASE } from '@/constant/index.js' // 设置的请求地址

// let isDev = process.env.NODE_ENV === 'development'
let setBaseUrl = uni.getStorageSync(SET_BASEURL) || ''
// let baseUrl = isDev ? TEST_URL : PROD_URL
let baseUrl = setBaseUrl

let printId = uni.getStorageSync(PRINT_BASE) + '' || ''
let printUrl = !printId.length > 0 ? PRINT_BASE_URL : printId
let joburl="http://172.16.100.133:8002" //调用iot的job接口

// 密码加密函数 登录使用
function encryption(src, keyWord) {
    const key = CryptoJS.enc.Utf8.parse(keyWord);
    // 加密
    var encrypted = CryptoJS.AES.encrypt(src, key, {
        iv: key,
        mode: CryptoJS.mode.CFB,
        padding: CryptoJS.pad.NoPadding,
    });
    return encrypted.toString();
}
/**
 * 登录
 * @param data
 * @returns {FlyPromise<any>}
 */
export const logIn = (data) => {
    const basicAuth = 'Basic bWluaTptaW5p';
    Session.set('basicAuth', basicAuth);
    // 密码加密
    const encPassword = encryption(data.password, 'pigxpigxpigxpigx');
    const { username, randomStr, code, grant_type, scope } = data;
    return request.post({
        url: baseUrl + '/api2/auth/oauth2/token',
        data: { username, randomStr, code, grant_type, scope, password: encPassword },
        header: {
            skipToken: true,
            Authorization: basicAuth,
            'content-type': 'application/x-www-form-urlencoded'
        }
    })
}
/**
 *  获取用户信息
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getCurrentUser = data => request.get({
    url: baseUrl + '/api2/admin/user/info',
    header: {
        'content-type': 'application/x-www-form-urlencoded'
    }
})

/**
 * 获取当前用户权限
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getUserPermission = data => request.post(baseUrl + '/api1/wms/AppVersionManage/GetUserAppMenu', data)

/**
 *  查询所有仓库
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getIsUsePageSetPDA = data => request.post(baseUrl + '/api1/wms/warehouse/QueryWarehouse', data)


/**
 * 首页的库存 首页和 图表界面的数据接口获取  饼图
 * @param data
 * @returns
 */
export const getPdaReportData = data => request.post(baseUrl + '/api1/report/homePageDocument/GetFinishProductMaterialSummary', data)

/**
 * 首页和  图表界面的数据接口获取   折线图
 * @param data
 * @returns
 */
export const getPdaLineGraph = data => request.post(baseUrl + '/api1/report/homePageDocument/GetDeliverySummary', data)

/**
 *  首页的导航点击进去的库存查询界面
 * @param data
 * @returns
 */
export const inventoryQuery = data => request.post(baseUrl + '/api1/report/homePageDocument/GetWarehouseMaterialSummary', data)

/**
 * 获取当前数据字典数据
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getDataDictionary = data =>
    request.post({
        url: baseUrl + '/api1/wms/getValueSet/GetDicItemByCode',
        data: data,
    })

/**
 *   获取打印机的服务器IP地址
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getDetailByCodeId = data => request.post(baseUrl + '/system/config/getDetailByCode?code=printEquipAddress')

/** 打印机测试
 * @param data
 * @returns {FlyPromise<any>}
 */
export const bigBarCodePrint = data =>
    request.post({
        url: printUrl + '/print/printTest',
        data: data,
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    })

export const printsLabels1 = data =>
    request.post({
        url: baseUrl + '/api1/wms/commonbarcode/BarcodePrint',
        data: data,
        // header: {
        //     'content-type': 'application/x-www-form-urlencoded'
        // }
    })
/**
 *  操作日志
 * @param data
 * @returns
 */
export const basPdaOperationLog = data => request.post(baseUrl + '/api1/wms/operationLog/CreateOperationLog', data)

/**
 * 根据barcode查询物料详情 扫描条码获取物料信息
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectWmsBarcodeInfoWms = data => request.post(baseUrl + '/api1/wms/Barcode/GetWmsBarcode', data)



/**
 * 上基材调出 查询送货单列表 销售出库
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findk3DnHs = data => request.post(joburl + '/job/distributedTransferOut/GetDistributedTransferOutDNList', data)

/**
 *  分布式调出 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getMaterialCodeInfOutk3 = data => request.post(joburl + '/job/distributedTransferOut/ScanDistributedTransferOutBarcode', data)



/**
 * 上基材调出 查询送货单详情
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findK3WmsDnHById = data => request.post(joburl + '/job/distributedTransferOut/GetDistributedTransferOutDNById', data)


/**
 * 上基材调出 条码信息
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanDistributedTransferOutBarcode = data => request.post(joburl + '/job/distributedTransferOut/ScanDistributedTransferOutBarcode', data)



/**
 * 上基材调出 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const submitDistributedTransferOut = data => request.post(joburl + '/job/distributedTransferOut/SubmitDistributedTransferOut', data)




/**
 * 条码管理  扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const barcodeManagementScan = data => request.post(baseUrl + '/api1/wms/Barcode/GetWmsBarcodeByBarcode', data)
/**
 * 拆分条码接口 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const splitBarcodeApi = data => request.post(baseUrl + '/api1/wms/Barcode/SplitBarcode', data)

/**
 * 合并条码 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const mergeBarcodeApi = data => request.post(baseUrl + '/api1/wms/Barcode/JoinBarcode', data)

/**
 * 托盘合并 的扫描托盘码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const PMScanningBarcode = data => request.post(baseUrl + '/api1/wms/Barcode/GetWmsBarcode', data)

/**
 * 托盘合并 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const PalletMerge = data => request.post(baseUrl + '/api1/wms/Barcode/TransferBarcode', data)

/**
 * 库位条码详情 查询
 * @param data
 * @returns {FlyPromise<any>}
 */
// export const barcodeByCondition = data => request.post(baseUrl + '/api1/wms/Barcode/GetWmsBarcode', data)
export const barcodeByCondition = data => request.post(baseUrl + '/api1/wms/Barcode/GetBarcodeLocationDetails', data)

/**
 * 拆分条码打印 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const barcodeSplitInfo = data => request.post(baseUrl + '/api1/wms/Barcode/GetSplitBarcodes', data)

/**
 * 获取当前服务器的当前日期的当前时间
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getSystemTime = data => request.post(baseUrl + '/api1/wms/commonUtil/GetCurrentTime', data)

/**
 * 来料入库 大料  五金  查询收料通知单列表
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findReceiptHs = data => request.post(baseUrl + '/api1/wms/receipt/GetReceiptList', data)

/**
 * 来料入库  大料入库  五金仓入库 查询收料通知单详情
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findReceiptHById = data => request.post(baseUrl + '/api1/wms/receipt/GetReceiptDetailDto', data)

/**
 * 来料入库  大料入库  五金仓入库 单条收货单明细
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getReceiptDetail = data => request.post(baseUrl + '/api1/wms/receipt/GetReceiptDetail', data)

/**
 * 来料入库 大料入库  五金仓入库 根据barcode查询物料详情
 * @param data
 * @returns {FlyPromise<any>}
 */
export const checkAndReturnBarcode = data => request.post(baseUrl + '/api1/wms/receipt/CheckAndReturnBarcode', data)
/**
 * 来料入库 扫描条码给 目的库位 赋值
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getLocationCodeByBarcode = data => request.post(baseUrl + '/wms/wmsLocation/getLocationCodeByBarcode', data)

/**
 * 来料入库 扫描条码 给判断是否为同一区域
 * @param data
 * @returns {FlyPromise<any>}
 */
export const isThereALibrary = data => request.post(baseUrl + '/wms/wmsLocation/isThereALibrary', data)

/**
 * 来料入库 提交来料入库
 * @param data
 * @returns {FlyPromise<any>}
 */
export const wmsCommitReceipt = data => request.post(baseUrl + '/api1/wms/instock/InStockSubmit', data)

/**
 * 来料入库中的 大料入库 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const wmsCommitReceipt2 = data => request.post(baseUrl + '/api1/wms/instock/BigMaterialSubmit', data)

/**
* 扫描库位  大料入库 库内调整
* @param data
* @returns {FlyPromise<any>}
*/
export const checkLocation = data => request.post(baseUrl + '/api1/wms/location/GetLocations', data)

/**
 *  库内调整 提交
 * @param {*} data
 * @returns
 */
export const houseLocationChange = data => request.post(baseUrl + '/api1/wms/barcode/AdjustBarcodeLocation', data)

/**
 *   半成品调拨 根据调入仓库，带出该仓库的生产库位
 * @param {*} data
 * @returns
 */
export const semiScanTransferIn = data => request.post(baseUrl + '/api1/wms/materialTransfer/SemiScanTransferIn/', data)

/**
 *   半成品调拨 扫描条码
 * @param {*} data
 * @returns
 */
export const scanSemiBarcode = data => request.post(baseUrl + '/api1/wms/materialTransfer/ScanSemiBarcode', data)

/**
 *   半成品调拨 提交
 * @param {*} data
 * @returns
 */
export const submitTransferSemi = data => request.post(baseUrl + '/api1/wms/materialTransfer/SubmitSemiTransfer', data)

/**
 *   原材料调拨 查询库位
 * @param {*} data
 * @returns
 */
export const scanTransferIn = data => request.post(baseUrl + '/api1/wms/materialTransfer/ScanTransferIn/' + data.warehouseCode)

/**
 *   原材料调拨 扫描条码
 * @param {*} data
 * @returns
 */
export const scanMaterialBarcode = data => request.post(baseUrl + '/api1/wms/materialTransfer/ScanMaterialBarcode/?barcode=' + data.barcode)

/**
 * 原材料调拨 提交
 * @param {*} data
 * @returns
 */
export const materialTransfer = data => request.post(baseUrl + '/api1/wms/materialTransfer/SubmitTransfer', data)

/**
 * 成品退库退料 扫描条码
 * @param {*} data
 * @returns
 */
export const selectReturnFGBarcode = data => request.post(baseUrl + '/api1/wms/returnFGToWarehouse/SelectReturnFGBarcode', data)

/**
 * 成品退库退料 提交
 * @param {*} data
 * @returns
 */
export const productReturnSubmit = data => request.post(baseUrl + '/api1/wms/returnFGToWarehouse/SubmitReturnFGToWarehouse', data)

/**
 * 退回原材料 扫描条码
 * @param {*} data
 * @returns
 */
export const returnToRmScan = data => request.post(baseUrl + '/api1/wms/returnToRm/ReturnToRmScan', data)

/**
 * 退回原材料 提交
 * @param {*} data
 * @returns
 */
export const returnToRmSubmit = data => request.post(baseUrl + '/api1/wms/returnToRm/ReturnToRmSubmit', data)

/**
 * 退回半成品 扫描条码
 * @param {*} data
 * @returns
 */
export const selectSemiFinishMaterialBarcode = data => request.post(baseUrl + '/api1/wms/returnSemiFinishMaterial/SelectSemiFinishMaterialBarcode', data)

/**
 * 退回半成品 提交
 * @param {*} data
 * @returns
 */
export const submitReturnSemiFinishMaterial = data => request.post(baseUrl + '/api1/wms/returnSemiFinishMaterial/SubmitReturnSemiFinishMaterial', data)

/**
* 销售出库 ，列表查询
* @param data
* @returns {FlyPromise<any>}
*/
export const getDNList = data => request.post(baseUrl + '/api1/wms/salesOut/GetDNList', data)

/**
* 销售出库  调出单信息
* @param data
* @returns {FlyPromise<any>}
*/
export const getDNById = data => request.post(baseUrl + '/api1/wms/salesOut/GetDNById', data)

/**
* 销售出库 扫描条码
* @param data
* @returns {FlyPromise<any>}
*/
export const selectDNBarcode = data => request.post(baseUrl + '/api1/wms/salesOut/SelectDNBarcode', data)

/**
* 销售出库 检查扫描的条码是不是 推荐库位的条码
* @param data
* @returns {FlyPromise<any>}
*/
export const checkBarcodeTime = data => request.post(baseUrl + '/api1/wms/salesOut/CheckRecommendedLocation', data)

/**
* 销售出库  进入二级页面调用的 物料推荐库位 查询
* @param data
* @returns {FlyPromise<any>}
*/
export const salesLocation = data => request.post(baseUrl + '/api1/wms/salesOut/SalesOutRecommendedLocation', data)

/**
* 销售出库 提交
* @param data
* @returns {FlyPromise<any>}
*/
export const submitSalesOut = data => request.post(baseUrl + '/api1/wms/salesOut/SubmitSalesOut', data)


/**
* 销售出库 扫描记录里面的条码状态
* @param data
* @returns {FlyPromise<any>}
*/
export const getBarcodeStatus = data => request.post(baseUrl + '/api1/wms/wmsBarcode/GetBarcodestatus', data)


/**
 * 其他出库  粉碎简单生产退料 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectWmsBarcodeInfoOther = data => request.post(baseUrl + '/api2/eletile-qms/basMaterial/selectWmsBarcodeInfo', data)
export const qmsScanBarcodeOther = data => request.post(baseUrl + '/api1/wms/qualityPick/QmsScanBarcode', data)

/**
 * 其他出库 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const iqcOutCommit = data => request.post(baseUrl + '/api2/eletile-qms/basMaterial/wjOutCommit', data)
export const qmsSubmitBarcodeCommit = data => request.post(baseUrl + '/api1/wms/qualityPick/QmsSubmitBarcode', data)

/**
 * 生产检验 根据工序查询产线信息
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findLineByProcessCode = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/findLineByProcessCode', data)

/**
 * 生产检验 根据工序查询检测项目 检验项
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findCheckDataProductTest = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/findCheckData', data)

/**
 * 生产检验 根据生产工序获取生产检验位置
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getProductionCheckByProcCode = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/getProductionCheckByProcCode', data)

/**
 * 生产检验 根据生产工序获取物料代码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getBomDByProdMaterial = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/getBomDyProdMaterial', data)

/**
 * 生产检验 历史记录查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findErrorRecord = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/findErrorRecord', data)

/**
 * 生产检验 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const commitErrorRecord = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/commitErrorRecord', data)

/**
 * 粉碎简单生产退料 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const otherInCommitBound = data => request.post(baseUrl + '/api2/eletile-qms/basMaterial/otherInCommit', data)

/**
 * 来料检验 根据入库单查询条码信息
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getfindLocationByCode = data => request.post(baseUrl + '/api2/eletile-qms/wmsInstockH/findLocationByCode', data)

/**
 * 来料检验 入库单信息列表查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getIncomingMaterial = data => request.post(baseUrl + '/api2/eletile-qms/wmsInstockH/findInStockHPage', data)

/**
 * 来料检验 库位明细查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getLibraryNumber = data => request.post(baseUrl + '/api2/eletile-qms/wmsInstockH/getLibraryDetails', data)

/**
 * 来料检验 结果 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const insertIqcCheck = data => request.post(baseUrl + '/api2/eletile-qms/wmsInstockH/insertIqcCheck', data)

/**
 *  成品检验 查询barcode
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectWmsBarcodeInfos = data => request.post(baseUrl + '/api2/eletile-qms/basMaterial/selectWmsBarcodeInfo', data)

/**
 *  成品检验 来料检验 根据物料code查询 当前物料检测项
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findRelationByCode = data => request.post(baseUrl + '/api2/eletile-qms/wmsInstockH/findRelationByCode', data)

/**
 * 成品检验 结果 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const insertFqcCheck = data => request.post(baseUrl + '/api2/eletile-qms/qmsFqcCheckH/insertFqcCheck', data)

/**
 * 过程检验 首页检测数据获取
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectPqcCheckByShift = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/selectPqcCheckByShift', data)

/**
 * 过程检验 首页 获取具体班次 每一行的产线纬度检测信息 查看
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectPqcItemCheckResult = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/selectCheckResult', data)

/**
 * 过程检验 获取某道工序的具体待检产线 开始
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectMeetLine = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/selectMeetLine', data)


/**
 * 过程检验 查询检测项目的符合产线 录入
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectMeetLineSecond = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/selectMeetLine', data)

/**
 * 过程检测 提交开始检测时间
 * @param data
 * @returns {FlyPromise<any>}
 */
export const fillStartTime = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/fillStartTime', data)

/**
 * 过程检 测查询检测项目
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectCheckProject = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/selectCheckProject', data)


/**
 *  获取 过程检验 检测结果
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectLastResultById = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/selectLastResultById', data)


/**
 * 过程检验 检测结果 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const insertPQCCheckResult = data => request.post(baseUrl + '/api2/eletile-qms/qmsPqcCheckH/insertPQCCheckResult', data)

/**
 * 二次检验 获取数据列表
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getSecondTestList = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/checkFailBarcodeListForPda', data)

/**
 * 二次检验 提交 弹窗确认
 * @param data
 * @returns {FlyPromise<any>}
 */
export const splitBarcodeForSecondCheck = data => request.post(baseUrl + '/api2/eletile-qms/wms/wmsBarcode/splitBarcodeForSecondCheck', data)

/**
 * 二次检测 结果 提交 批量提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const updateSecondQcStatusForPda = data => request.post(baseUrl + '/api2/eletile-qms/qmsProductionCheck/updateSecondQcStatusForPda', data)


/**
 * 原材料采购退料（采购退料）  查询采购入库单 采购退料五金仓退料 查询采购入库单
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getWmsInStockPage = data => request.post(baseUrl + '/api1/wms/rawPurReturn/GetPurInstockList', data)

/**
 * 原材料采购退料（采购退料） 采购退料五金仓退料  查询采购入库单详情
 * @param data
 * @returns {FlyPromise<any>}
 */
export const wmsInStockInfoById = data => request.post(baseUrl + '/api1/wms/rawPurReturn/GetPurInstockById', data)

/**
 * 原材料采购退料（采购退料） 采购退料五金仓退料  扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectRawPurReturnBarcode = data => request.post(baseUrl + '/api1/wms/rawPurReturn/SelectRawPurReturnBarcode', data)

/**
 * 原材料采购退料（采购退料） 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const commitRefund = data => request.post(baseUrl + '/api1/wms/rawPurReturn/SubmitRawPurReturnInput', data)

/**
 * 原材料次品出库 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanRawErrorBarcode = data => request.post(baseUrl + '/api1/wms/rawErrorOutStock/ScanRawErrorBarcode', data)

/**
 * 原材料次品出库 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const submitRawErrorBarcode = data => request.post(baseUrl + '/api1/wms/rawErrorOutStock/SubmitRawErrorBarcode', data)

/**
 *  返还五金仓 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanHardwareBarcodeReturn = data => request.post(baseUrl + '/api1/wms/returnHardwareWarehouse/ScanHardwareBarcode', data)
/**
 * 返还五金仓 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const submitReturnHardwareWarehouse = data => request.post(baseUrl + '/api1/wms/returnHardwareWarehouse/SubmitReturnHardwareWarehouse', data)

/**
 *  五金仓出库 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanHardwareBarcode = data => request.post(baseUrl + '/api1/wms/hardwareWarehouseOut/ScanHardwareBarcode', data)

/**
 * 五金仓出库 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const submitHardwareWarehouseOut = data => request.post(baseUrl + '/api1/wms/hardwareWarehouseOut/SubmitHardwareWarehouseOut', data)


/**
 *  分布式调出 查询送货单列表 首页
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findDnHs = data => request.post(baseUrl + '/api1/wms/distributedTransferOut/GetDistributedTransferOutDNList', data)

/**
 *  分布式调出 查询送货单详情 通过ID查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findWmsDnHById = data => request.post(baseUrl + '/api1/wms/distributedTransferOut/GetDistributedTransferOutDNById', data)

/**
 *  分布式调出 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getMaterialCodeInfOut = data => request.post(baseUrl + '/api1/wms/distributedTransferOut/ScanDistributedTransferOutBarcode', data)

/**
 *  分布式调出 扫描托盘 WMS校验木托盘有没有被绑定
 * @param data
 * @returns {FlyPromise<any>}
 */
export const checkQrCodeIsBindWMS = data => request.post(baseUrl + '/api1/wms/distributedTransferOut/scanQRCode', data)

/**
 *  分布式调出    提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const sdistributedCallOut = data => request.post(baseUrl + '/api1/wms/distributedTransferOut/SubmitDistributedTransferOut', data)

/**
 *  分布式调入 查询调出单列表
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectStepoutH = data => request.post(baseUrl + '/api1/wms/distributedTransferIn/GetStepOutDNList', data)

/**
 *  分布式调入 扫码条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanStepInBarcode = data => request.post(baseUrl + '/api1/wms/distributedTransferIn/ScanStepInBarcode', data)

/**
 *  分布式调入 根据id查询调入单详情
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findStepoutHById = data => request.post(baseUrl + '/api1/wms/distributedTransferIn/GetStepOutDNById', data)

/**
 *  分布式调入 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const distributedCallIn = data => request.post(baseUrl + '/api1/wms/distributedTransferIn/SubmitDistributedTransferIn', data)

/**
 *  半成品次品粉碎 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanSemiProductBarcode = data => request.post(baseUrl + '/api1/wms/semiProductErrorCrush/ScanSemiProductBarcode', data)

/**
 *  半成品次品粉碎 提交 扫码做其他出库和简单生产退料
 * @param data
 * @returns {FlyPromise<any>}
 */
export const submitSemiProductErrorCrush = data => request.post(baseUrl + '/api1/wms/semiProductErrorCrush/SubmitSemiProductErrorCrush', data)

/**
 * 成品库内调整  获取点位
 */
export const getLocationPoint = data => request.post(baseUrl + '/api1/wms/point/GetLocationPoint', data)
/**
 * 成品库内调整  获取IOT库位运行情况
 */
export const getIOTUsedLocation = data => request.post(baseUrl + '/api1/wms/location/GetIOTUsedLocation', data)
/**
 * 成品库内调整  锁定 解锁 库位
 */
export const setLocationLockStatus = data => request.post(baseUrl + '/api1/wms/location/SetLocationLockStatus', data)
export const setLocationLockStatusBatch = data => request.post(baseUrl + '/api1/wms/location/SetLocationLockStatusBatch', data)
/**
 * 成品库内调整  提交
 */
export const adjustBarcodeLocation = data => request.post(baseUrl + '/api1/wms/barcode/AdjustBarcodeLocation_FinishProduct', data)

/**
 *  上基材的投料  上料优先级
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getLvtInfo = data => request.post(baseUrl + '/api1/wms/commonBom/GetPriorityMaterial', data)

/**
* 成品补录  扫描条码
* @param data
* @returns {FlyPromise<any>}
*/
export const selectWmsBarcodeInfoForFPSupplement = data => request.post(baseUrl + '/api1/wms/instock/IOTScanBarcode/' + data.barcode)

/**
 * 成品补录 获取点位当前产出料号
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getFinishedProduct = data => request.post(baseUrl + '/api1/wms/instock/ProductionLineMaterial', data)

/**
 * 成品补录 保存
 */
export const saveFinishedProduct = data => request.post(baseUrl + '/api1/iot/open/GenerateFinishedGoodsRecordNew', data)

/**
 * NG标记 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getHgBarCodeResponse = data => request.post(baseUrl + '/api1/iot/open/GetNgBarCodeResponse', data)

/**
 * NG标记 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const modifyTrayStatusInRestArea = data => request.post(baseUrl + '/api1/iot/open/ModifyTrayStatusInRestArea', data)

/**
 * NG标记 提交 二次弹框的接口
 * @param data
 * @returns {FlyPromise<any>}
 */
export const moveInRestArea = data => request.post(baseUrl + '/api1/iot/open/ModifyTrayStatusInRestArea', data)

/**
 * NG标记 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getNgList = data => request.post(baseUrl + '/api1/iot/open/GetNgList', data)

/**
 * 托盘校准 获取字典项数据 工序 点位
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getDicData = data => request.post(baseUrl + '/api1/iot/open/GetDicData', data)


/**
 * 托盘校准 获取字典项数据 工序 点位
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getDicDataPda = data => request.post(baseUrl + '/api1/iot/open/GetDicDataPda', data)


/**
 * IOT扫描 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const iotScan = data => request.post(baseUrl + '/api1/iot/open/IotScan', data)



/**
 * IOT扫描 根据agv编号获取位置
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getAgvTaskProcessLineLocation = data => request.post(baseUrl + '/api1/iot/open/GetAgvTaskProcessLineLocation?agvCode=' + data, null)

/**
 * 托盘校准 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const modifyEmptyLocationQty = data => request.post(baseUrl + '/api1/iot/open/ModifyEmptyLocationQty', data)

/**
 * 成品库位明细 查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getFGLocationBarcodeDetail = data => request.post(baseUrl + '/api1/wms/instock/GetFGLocationBarcodeDetail', data)

/**
 * 成品库位明细 打印
 * @param data
 * @returns {FlyPromise<any>}
 */
export const printFGBarcode = data => request.post(baseUrl + '/api1/wms/instock/PrintFGBarcode', data)

/**
 * AGV任务管理 查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getTaskInfo = data => request.post(baseUrl + '/api1/iot/open/GetTaskInfo', data)
/**
 * AGV任务管理 任务详情 获取表格
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getTaskStepByTaskCode = data => request.post(baseUrl + '/api1/iot/open/GetTaskStepByTaskCode?taskCode=' + data.taskCode)

/**
 * AGV任务管理 更改优先级
 * @param data
 * @returns {FlyPromise<any>}
 */
export const modifyTaskPriority = data => request.post(baseUrl + '/api1/iot/open/ModifyTaskPriority', data)

/**
 * AGV任务管理 更改目的地
 * @param data
 * @returns {FlyPromise<any>}
 */
export const modifyTaskLocation = data => request.post(baseUrl + '/api1/iot/open/ModifyTaskLocation', data)


/**
 * 通过条码号获取产出信息
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getLastOutPutByCarton = data => request.post(baseUrl + '/api1/iot/open/GetLastOutPutByCarton?cartonCode=' + data, null)



/**
 * AGV任务管理 取消任务
 * @param data
 * @returns {FlyPromise<any>}
 */
export const cancelTaskByTaskCode = data => request.post(baseUrl + '/api1/iot/open/CancelTaskByTaskCode?taskCode=' + data.taskCode)

/**
 * AGV任务管理 删除任务
 * @param data
 * @returns {FlyPromise<any>}
 */
export const delTaskByTaskCode = data => request.post(baseUrl + '/api1/iot/open/DelTaskByTaskCode?taskCode=' + data.taskCode)

/**
 * AGV任务管理 创建任务
 * @param data
 * @returns {FlyPromise<any>}
 */
export const createTask = data => request.post(baseUrl + '/api1/iot/open/CreateTask', data)

/**
 * AGV任务管理 获取任务日志
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getTaskLogByTaskCode = data => request.post(baseUrl + '/api1/iot/open/GetTaskLogByTaskCode?taskCode=' + data.taskCode)

/**
 * AGV任务管理 提交任务
 * @param data
 * @returns {FlyPromise<any>}
 */
export const submitTaskByTaskCode = data => request.post(baseUrl + '/api1/iot/open/SubmitTaskByTaskCode?taskCode=' + data.taskCode)

/**
 *  版本更新
 * @param data
 * @returns {FlyPromise<any>}
 */
export const appUpdate = data =>
    request.post({
        url: baseUrl + '/api1/wms/AppVersionManage/CheckAppVersion',
        data: data,
        // header: {
        //     'content-type': 'application/x-www-form-urlencoded'
        // }
    })

/**
 * 库位请求
 * @param data
 * @returns {FlyPromise<any>}
 */
export const locationRequest = (url, data) => request.post(baseUrl + url, data)
export const locationRequestFrom = (url, data) =>
    request.post({
        url: baseUrl + url,
        data: data,
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    })

/**
 * 简单生产领料 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const wmsSelectWmsBarcodeInfo = data => request.post(baseUrl + '/api1/wms/barcode/CheckEasyPrdIssueBarcode', data)

/**
 * 简单生产领料 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const simpleProductionPicking = data => request.post(baseUrl + '/api1/wms/barcode/EasyPrdIssue', data)

/**
 * 盘点 列表数据 首页
 * @param {*} data
 * @returns
 */
export const findStartCheckStock = data => request.post({
    url: baseUrl + '/api2/eletile-mes/wmsCheckstockWarehouseD/findStartCheckStock',
    data: data,
    header: {
        'content-type': 'application/x-www-form-urlencoded'
    }
})
// request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockWarehouseD/findStartCheckStock', data)
/**
 * 盘点 二级画面 详情
 * @param {*} data
 * @returns
 */
export const findStartCheckStockDetail = data => request.get(baseUrl + '/api2/eletile-mes/wmsCheckstockWarehouseD/findCheckStockDetail', data)

/**
 * 盘点 根据barcode查询仓库中的物料 扫描条码
 */
export const selectWmsCheckstockDByBarcodeAndCheckStockId = data => request.post({
    url: baseUrl + '/api2/eletile-mes/wmsCheckstockD/selectOneByCode',
    data: data,
    header: {
        'content-type': 'application/x-www-form-urlencoded'
    }
})

/**
 * 盘点  扫描条码 的 提交
 * @param {*} data
 * @returns
 */
export const checkStockCommit = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockD/commit', data)

/**
 * 盘点 扫描条码后 查询提交记录条码维度
 * @param {*} data
 * @returns
 */
export const getCheckBarcodeByHIdForPda = data => request.post({
    url: baseUrl + '/api2/eletile-mes/wmsCheckstockD/getCheckBarcodeByHIdForPda',
    data: data,
    header: {
        'content-type': 'application/x-www-form-urlencoded'
    }
})

/**
 * 盘点 校验当前用户是否有盘点资格
 * @param {*} data
 * @returns
 */
export const inventoryStaff = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockH/inventoryStaff', data)

/**
 * 盘点审核
 * @param {*} data
 * @returns
 */
export const checkStockAudit = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockWarehouseD/checkStockAudit', data)



/**
 *  投料 扫描物料条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const barcodeInfoForFeeding = data =>
    request.post(baseUrl + '/wms/wmsBarcode/getBarcodeInfoForFeeding' + '?str=' + data)

/**
 *  生产退料 点击 确定
 * @param data
 * @returns {FlyPromise<any>}
 */
export const returnOfMaterial = data => request.post(baseUrl + '/api2/eletile-mes/mesBillsRule/createdCode' + '?ruleCode=' + data)

/**
 *  生产退料 提交 与 打印
 * @param data
 * @returns {FlyPromise<any>}
 */
export const saveOfMaterial = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockD/returnRecord', data)


/**
 *  打印机列表
 * @param data
 * @returns {FlyPromise<any>}
 */
export const bigBarCodePrintList = data =>
    request.post(baseUrl + '/mes/iotBaseinfoH/getIotBaseinfoDByCode?code=printerSetup', data)



/**
 *  修改密码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const updateModifyPassword = data => request.put(baseUrl + '/api2/admin/user/personal/password', data)



/*  打印接口
 * @param data
 * @returns {FlyPromise<any>}
 */
export const printsLabels = data =>
    request.post({
        url: printUrl + '/print/RawMaterialBarCodePrint',
        data: data,
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    })

/**
 *  通知列表 暂无使用
 * @param data
 * @returns {FlyPromise<any>}
 */
export const listBizMessageByUserNameId = data =>
    request.post({
        url: baseUrl + '/digital/sysInfoBizMessage/getPageSetByUserNameId',
        data: data,
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    })

/**
 *  更新 通知 列表
 * @param data
 * @returns {FlyPromise<any>}
 */
export const updateReadFlag = data =>
    request.post({
        url: baseUrl + '/api1/wms/message/SetReadFlagY',
        data: data,
        // header: {
        //     'content-type': 'application/x-www-form-urlencoded'
        // }
    })

/**
 *  成品盘点  首页（新）
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findFGStartCheckStock = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockH/findFGStartCheckStock', data)

/**
 *  成品盘点  二级页面顶部
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectK3andMESTotal = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockH/SelectK3andMESTotal', data)

/**
 *  成品盘点  提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const checkFGStockSubmit = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockWarehouseD/checkFGStockSubmit', data)

/**
 *  物料调拨  提交中的第二个接口,将数据保存到投料记录
 * @param data
 * @returns {FlyPromise<any>}
 */
export const saveInputRecord = data => request.post(baseUrl + '/mes/mesInputRecord/saveInputRecord', data)

/**
 *  简单生产入库  提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const simpleProductionInstock = data => request.post(baseUrl + '/wms/wmsBarcode/simpleProductionInstock', data)
/**
 * 消息通知接口
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getNotReadMsg = data => request.post(baseUrl + "/api1/wms/message/GetMessages", data)
export const getNotReadHomeMsg = data =>
    request.post({
        url: baseUrl + '/wms/sysInfoBizMessage/getIndexNotReadMsg',
        data: data,
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    })

/**
 *  标记消息已读
 * @param data
 * @returns {FlyPromise<any>}
 */
export const updateMsg = data =>
    request.post({
        url: baseUrl + '/wms/sysInfoBizReceiver/update',
        data: data,
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    })

/**
 *  原材料转移  扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectBarcodeForTransfer = data => request.post(baseUrl + '/wms/wmsBarcode/selectBarcodeForTransfer', data)

/**
 *  原材料转移  提交
 * @param data
 * @returns
 */
export const submitTransfer = data => request.post(baseUrl + '/wms/wmsBarcode/Transfer', data)

/**
 * 简单生产退料 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const simpleProductionReturn = data => request.post(baseUrl + '/wms/wmsBarcode/simpleProductionReturn', data)

/**
 *  主页的单据查询6个接口
 * @param data
 * @returns {FlyPromise<any>}
 */
export const pdaReport = data => request.post(baseUrl + '/wms/pdaReport/pdaReport', data)
// 采购入库单
export const getInStocks = data => request.post(baseUrl + '/api1/report/homePageDocument/GetInStocks', data)
// 销售出库单
export const getDns = data => request.post(baseUrl + '/api1/report/homePageDocument/GetDns', data)
// 分布式调出单
export const getStepouts = data => request.post(baseUrl + '/api1/report/homePageDocument/GetStepouts', data)
// 分布式调入单
export const getStepins = data => request.post(baseUrl + '/api1/report/homePageDocument/GetStepins', data)
// 其他出库单
export const getOtherDns = data => request.post(baseUrl + '/api1/report/homePageDocument/GetOtherDns', data)
// 采购退料单
export const getPurchaseReturns = data => request.post(baseUrl + '/api1/report/homePageDocument/GetPurchaseReturns', data)
// 简单生产领料
export const getEasyProductIns = data => request.post(baseUrl + '/api1/report/homePageDocument/GetEasyProductIns', data)
// 简单生产退料
export const getEasyProductReturns = data => request.post(baseUrl + '/api1/report/homePageDocument/GetEasyProductReturns', data)
// 直接调拨单
export const directTransfeOrder = data => request.post(baseUrl + '/api1/report/homePageDocument/GetDirectTransfer', data)

/**
 *  原材料调拨  今日推荐用量
 * @param data
 * @returns {FlyPromise<any>}
 */
export const pickingApplication = data => request.post(baseUrl + '/wms/basMaterial/pickingApplication', data)
export const pickingApplication1 = data => request.post(baseUrl + '/wms/basMaterial/pickingApplication1', data)


/**
 * 获取SOP目录 标题
 */
export const getSopCategory = () => request.get({
    url: baseUrl + '/api2/eletile-mes/CodeItem/getListByPid?current=1&size=20',
})
/**
 * 获取SOP列表 数据
 * @param title
 * @param categoryId
 * @returns {Request<AjaxResponse<any>>}
 */
export const getSopPageSet = (title, categoryId, page, rows) => {
    return request.get({
        url: baseUrl + '/api2/eletile-mes/sysArchive/page?CategoryId=' + categoryId + '&current=' + page + '&size=' + rows + '&title=' + title,
    })
}
/**
 * 获取sop
 * @param uuid
 * @returns {Request<AjaxResponse<any>>}
 */
export const getSopDetail = uuid => request.get(baseUrl + "/api2/eletile-mes/sysFile/getDetailByUuid?uuid=" + uuid)

/**
 * 获取SOP文件列表
 * @param uuid
 * @returns {Request<AjaxResponse<any>>}
 */
export const getSopFiles = uuid => request.get(baseUrl + '/api2/eletile-mes/sysFile/listByBizId?bizId=' + uuid)

/**
 * 获取SOP文件列表的类型
 * @param uuid
 * @returns {Request<AjaxResponse<any>>}
 */
export const getViewType = uuid => request.get(baseUrl + '/api2/eletile-mes/sysFile/getViewType?bizId=' + uuid)

/**
*  成品入库  获取推荐库位
* @param data
* @returns {FlyPromise<any>}
*/
export const pdaRecommendLocation = data => request.post(baseUrl + '/api1/wms/instock/pdaRecommendLocation', data)
/**
 *  成品入库  推荐库位 锁定或解锁
 * @param data
 * @returns {FlyPromise<any>}
 */
export const pdaLockLocation = data => request.post(baseUrl + '/api1/wms/instock/PdaLockLocation', data)

/**
 *  成品入库 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */export const instockBarcodeDetail = data => request.post(baseUrl + `/api1/wms/instock/PdaScanBarcode/${data}`)

/**
 *  成品入库  提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const pdaSubmitInstock = data => request.post(baseUrl + '/api1/wms/instock/PdaSubmitInstock', data)

/**
 *  图片上传
 * @param data
 * @returns {FlyPromise<any>}
 */
export const uploadImg = data => request.post(baseUrl + '/api2/sys-minio/upload', data)

/**
 * 成品入库  扫描记录删除
 * @param data
 * @returns {FlyPromise<any>}
 */
export const deleteOccupancy = data => request.post(baseUrl + '/api1/wms/instock/DeleteOccupancy', data)


/**
 * 生产退料  盘点单号
 * @param data
 * @returns {FlyPromise<any>}
 */
export const findCheckStockHForPda = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockH/findCheckStockHForPda', data)

/**
* 销售出库 检查扫描的条码 是不是最早库位的条码
* @param data
* @returns {FlyPromise<any>}
*/
export const getMaterialTransferBarcode = data => request.post(baseUrl + '/wms/wmsBarcode/getMaterialTransferBarcode', data)

/**
 * IOT扫描提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const updateD = data => request.post(baseUrl + '/mes/iotBaseinfoH/updateDetail?id=' + data.hid + '&barcode=' + data.value, {})

/**
* 成品盘点 顶部信息
* @param data
* @returns {FlyPromise<any>}
*/
export const getInventoryTopInfo = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockD/getInventoryTopInfo', data)

/**
* 盘点 '盘点-RM-原材料'  获取总托数和物项总数
* @param data
* @returns {FlyPromise<any>}
*/
export const getTotalAndItems = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockD/getTotalAndItems', data)

/**
*盘点 '盘点-RM-原材料'  根据物料代码 查询物料详情
* @param data
* @returns {FlyPromise<any>}
*/
export const getInventoryInfo = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockD/getInventoryInfo', data)

/**
*盘点 '盘点-RM-原材料'  库存详情点击进去的 扫描记录
* @param data
* @returns {FlyPromise<any>}
*/
export const getDetailInfo = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockD/getDetailInfo', data)


/**
 *  盘点   '盘点-RM-原材料' 二级页面 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const selectWmsCheckStocked = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockH/selectWmsCheckstockd', data)

/**
*'盘点-RM-原材料' 点击盘点或者取消盘点
* @param data
* @returns {FlyPromise<any>}
*/
export const checkPDA = data => request.post(baseUrl + '/api2/eletile-mes/wmsCheckstockD/checkPDA', data)

/**
* 大料入库  扫描条码
* @param data
* @returns {FlyPromise<any>}
*/
export const getProcessLocationByPrdLineId = data => request.post(baseUrl + '/api1/wms/process/GetProcessLocationByPrdLineId', data)
export const getMaterials = data => request.post(baseUrl + '/api1/wms/material/GetMaterials', data)

/**
* 大料入库  获取物料
* @param data
* @returns {FlyPromise<any>}
*/
export const getBaseDataTank = data => request.post(baseUrl + '/api1/iot/open/GetBaseData', data)

/**
* 大料入库  提交
* @param data
* @returns {FlyPromise<any>}
*/
export const iOTOutputDataEntry = data => request.post(baseUrl + '/api1/iot/open/IOTOutputDataEntry', data)

/**
* 条码变更 提交
* @param data
* @returns {FlyPromise<any>}
*/
export const changeBarcodeSubmit = data => request.post(baseUrl + '/wms/wmsBarcode/changeBarcodeSubmit', data)

/**
 * 开槽灰入库 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const slottedAshInstock = data => request.post(baseUrl + '/wms/wmsBarcode/slottedAshInstock', data)

/**
 * 开槽灰入库 历史记录
 * @param data
 * @returns {FlyPromise<any>}
 */
export const slottedAshInstockHistory = data => request.post(baseUrl + '/wms/WmsBarcodeBusinesslog/getPageSet', data)
/**
 * 开槽灰入库 删除
 * @param data
 * @returns {FlyPromise<any>}
 */
export const deleteSlottedAshInstock = data => request.post(baseUrl + '/wms/WmsBarcodeBusinesslog/deleteSlottedAshInstock', data)
/**
 * 开槽灰出库 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const slottedAshOutstock = data => request.post(baseUrl + '/wms/wmsBarcode/slottedAshOutstock', data)

/**
 * 销售订单查询 查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getPageSetOrderH = data => request.post(baseUrl + '/mes/mesSalesorderH/getPageSet?soDateStartTime=' + data.soDateStartTime + '&soDateEndTime=' + data.soDateEndTime + '&soCode=' + data.soCode + '&pages=' + data.pages + '&rows=' + data.rows, data)

/**
 * 销售订单查询 查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getPageSetOrderD = data => request.post(baseUrl + '/mes/mesSalesorderD/getPageSet?soid=' + data.soid, data)

/**
 * 销售订单查询 打印
 * @param data
 * @returns {FlyPromise<any>}
 */
export const printBOL = data => request.post(baseUrl + '/wms/hmtxPo/printBOL', data)

/**
 * 销售订单查询 上传
 * @param data
 * @returns {FlyPromise<any>}
 */
export const uploadBOL = data => request.post(baseUrl + '/wms/hmtxPo/uploadBOL', data)

/**
 * 成品库内调整验证条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const VerifyBarcode = data => request.post(baseUrl + '/api1/wms/barcode/VerifyBarcode', data)

/**
 * 固资盘点 首页查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getAssetCardCheckStockList = data => request.post(baseUrl + '/api1/wms/AssetCardCheckStock/GetAssetCardCheckStockList', data)

/**
 * 固资盘点 汇总数据
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getAssetCardCheckStockInfo_PDA = data => request.post(baseUrl + '/api1/wms/assetCardCheckStock/GetAssetCardCheckStockInfo_PDA', data)

/**
 * 固资盘点 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanAssetCard_PDA = data => request.post(baseUrl + '/api1/wms/assetCardCheckStock/ScanAssetCard_PDA', data)

/**
 * 固资盘点 盘点/取消
 * @param data
 * @returns {FlyPromise<any>}
 */
export const checkAssetCardOrNO_PDA = data => request.post(baseUrl + '/api1/wms/assetCardCheckStock/CheckAssetCardOrNO_PDA', data)

/**
 * 固资盘点 扫描记录查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getAssetCardCheckStockDetailList = data => request.post(baseUrl + '/api1/wms/assetCardCheckStock/GetAssetCardCheckStockDetailList', data)

/**
 * 固资盘点 盘点/取消
 * @param data
 * @returns {FlyPromise<any>}
 */
export const auditAssetCardCheckStock_PDA = data => request.post(baseUrl + '/api1/wms/assetCardCheckStock/AuditAssetCardCheckStock_PDA', data)

/**
 * 固资管理 打印
 * @param data
 * @returns {FlyPromise<any>}
 */
export const printCardAssets = data => request.post(baseUrl + '/api2/eletile-digital/wmsAssetCard/printCard', data)
/**
 * 新来料入库 扫码条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const checkAndReturnBarcode2 = data => request.post(baseUrl + '/api1/wms/receipt/CheckAndReturnBarcode_New', data)
/**
 * 新来料入库 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const wmsCommitReceiptNew = data => request.post(baseUrl + '/api1/wms/instock/InStockSubmit_New', data)

/**
 * 新来料入库、新原材料库内调整 、新分布式调入  占用库位的取消
 * @param data
 * @returns {FlyPromise<any>}
 */
export const cancelOccupy = data => request.post(baseUrl + '/api1/wms/commonLocation/CancelOccupyLocation', data)

/**
 * 新分布式调入 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanStepInBarcodeNew = data => request.post(baseUrl + '/api1/wms/distributedTransferIn/ScanStepInBarcode_New', data)

/**
 * 新分布式调入 提交
 * @param data
 * @returns {FlyPromise<any>}
 */
export const distributedCallInNew = data => request.post(baseUrl + '/api1/wms/distributedTransferIn/SubmitDistributedTransferIn_New', data)

/**
 * 新原材料库内调整 扫描条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getLocationByForRM = data => request.post(baseUrl + '/wms/wmsMaterialCapacity/getLocationByForRM', data)

/**
 *新 原材料库内调整 占用库位
 * @param data
 * @returns {FlyPromise<any>}
 */
export const locationOccupyRM = data => request.post(baseUrl + '/api1/wms/CommonLocation/OccupyLocationWareIn', data)

/**
 * 新原材料库内调整 二次扫码条码调用 占用库位、取消
 * @param data
 * @returns {FlyPromise<any>}
 */
export const locationOccupyByScanRM = data => request.post(baseUrl + '/api1/wms/Barcode/LocationOccupyByScan', data)

/**
 *  新原材料库内调整 提交
 * @param {*} data
 * @returns
 */
export const houseLocationChangeNew = data => request.post(baseUrl + '/api1/wms/barcode/AdjustBarcodeLocation_New', data)

/**
 * 新原材料调拨 扫码领料单
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanReqNo = data => request.post(baseUrl + '/api1/wms/pickApply/ScanPickApply', data)

/**
 * 新原材料调拨 扫码条码
 * @param data
 * @returns {FlyPromise<any>}
 */
export const scanMaterialBarcodeNew = data => request.post(baseUrl + '/api1/wms/MaterialTransfer/ScanMaterialBarcodeWithPickApply', data)

/**
 * 新原材料调拨 提交
 * @param {*} data
 * @returns
 */
export const materialTransferNew = data => request.post(baseUrl + '/api1/wms/MaterialTransfer/SubmitTransferWithPickApply', data)

/**
 * 新原材料调拨 推荐调拨条码 查询
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getDetailByReqNo = data => request.post(baseUrl + '/api1/wms/pickApply/GetPickApplyBarcodes', data)

/**
 * 新原材料调拨 获取调拨类型
 * @param data
 * @returns {FlyPromise<any>}
 */
export const getTranferStatus = data => request.post(baseUrl + '/api1/wms/pickApply/GetTranferStatus', data)



/**
 *PVC吨包投料
 * @param data
 * @returns {FlyPromise<any>}
 */
export const pvcTonInput = data => request.post(baseUrl + '/api1/wms/TonBagInput/SubmitPVCTonBagFeeding', data)



/**
 *开槽灰吨包投料
 * @param data
 * @returns {FlyPromise<any>}
 */
export const fsCardTonInput = data => request.post(baseUrl + '/api1/wms/TonBagInput/SubmitSlottedGrayTonBagFeeding', data)



/**
 *LVT废板报工
 * @param data
 * @returns {FlyPromise<any>}
 */
export const lvtBoardWorker = data => request.post(baseUrl + '/api1/wms/TonBagInput/SubmitLVTScrapReport', data)



/**
 * 设置上料优先级
 * @param data
 * @returns {FlyPromise<any>}
 */
export const setFeeedingSort = data => request.post(baseUrl + '/api1/iot/open/SetFeeedingSort', data)



/**
 * 设置打包NG
 * @param data
 * @returns {FlyPromise<any>}
 */
export const setDRNg = data => request.post(baseUrl + '/api1/iot/open/SetDRNg', data)

